// keygrip_my_demo.js

const Keygrip = require("keygrip");

const keys = Keygrip(['wxg']);

(function main() {
    test3();
    // test2();
    // test1();
})();



function test3() {
    const hash = keys.sign('helloworld');
    console.log('hash: ', hash);
    matched = keys.verify("bieberschnitzel", hash)
    console.log(matched);
    console.log(keys.verify("helloworld", hash));
    console.log(keys.verify("hello", keys.sign('hello')));
}


function test2() {
    const hash = keys.sign('helloworld');
    console.log(hash);
    let index = keys.index('hello', hash);
    console.log('index: ', index);
    console.log('index: ', keys.index('helloworld', hash));
    console.log(keys.sign('hello'));
    console.log('index: ', keys.index('helloworld', keys.sign('helloworld')));
    console.log('index: ', keys.index('hello', keys.sign('hello')));
}

function test1() {
    const hash = keys.sign('helloworld');
    console.log(hash);
    console.log(keys.sign('helloworld'));
}

